<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('单页文章信息'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#cms_a"><?php echo $this->translate('基本信息'); ?></a></li>
                <li><a data-toggle="tab" href="#cms_b"><?php echo $this->translate('搜索引擎优化'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="cms_form" id="cms_form" method="post" action="">
              <input type="hidden" name="single_article_id" id="single_article_id" value="<?php if($this->single_article_info) echo $this->single_article_info->single_article_id; else echo ''; ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->single_article_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('单页文章'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('cms/default',array('action'=>'singleArticle','controller'=>'cms')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回单页文章列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->single_article_info) { ?>
                    <a href="javascript:;" onclick="return single_article_del_js(<?php echo $this->single_article_info->single_article_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除单页文章'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存单页文章信息'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('cms_single_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="cms_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章标题'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="single_article_title"  name="single_article_title" class="span8" value="<?php echo ($this->single_article_info ? $this->escapeHtml($this->single_article_info->single_article_title) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章标签'); ?>：</label>
           					<div class="controls">
              					<select id="article_tag" name="article_tag" class="span2">
                                <option value=""><?php echo $this->translate('不选择标签'); ?></option>
                                <?php
                                if ($this->article_tag_type) {
                                	foreach ($this->article_tag_type as $tag_type_key => $tag_type_val) {
								?>
                                <option value="<?php echo $tag_type_key ?>" <?php if($this->single_article_info and $this->single_article_info->article_tag == $tag_type_key) { ?>selected="selected"<?php } ?>><?php echo $this->escapeHtml($tag_type_val); ?></option>
                                <?php
                                	}
                                }
								?>
                                </select>
            				</div>                        
                        </div>
                    	<!--div class="control-group">
                  			<label for="input01" class="control-label"><?php //echo $this->translate('文章作者'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="single_article_writer"  name="single_article_writer" class="span5" value="<?php echo ($this->single_article_info ? $this->escapeHtml($this->single_article_info->single_article_writer) : ''); ?>">
            				</div>                        
                        </div -->
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章内容'); ?>：</label>
           					<div class="controls">
              					<script type="text/plain" id="single_article_body" name="single_article_body"><?php echo ($this->single_article_info ? $this->single_article_info->single_article_body : ''); ?></script>
            				</div>                        
                        </div>                        
                        <!--div class="control-group">
                  			<label for="input01" class="control-label"><?php //echo $this->translate('文章创建时间'); ?>：</label>
           					<div class="controls">
              					<input type="text"  id="single_article_add_time"  name="single_article_add_time" value="<?php echo ($this->single_article_info ? date('Y-m-d H:i', $this->single_article_info->single_article_add_time) : ''); ?>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',el:'single_article_add_time'})" class="span3 Wdate">
            				</div>                        
                        </div-->
                  	</div>
                </div>
				<div id="cms_b" class="tab-pane">
                	<div class="well admin_add_header_well"><?php echo $this->translate('搜索引擎优化'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('扩展标题'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="single_article_title_extend"  name="single_article_title_extend" class="span12" value="<?php echo ($this->single_article_info ? $this->escapeHtml($this->single_article_info->single_article_title_extend) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章关键字'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="single_article_keywords"  name="single_article_keywords" class="span12" value="<?php echo ($this->single_article_info ? $this->escapeHtml($this->single_article_info->single_article_keywords) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章描述'); ?>：</label>
           					<div class="controls">
              					<textarea id="single_article_description"  name="single_article_description" class="span12" rows="3"><?php echo ($this->single_article_info ? $this->escapeHtml($this->single_article_info->single_article_description) : ''); ?></textarea>
            				</div>                        
                        </div>                    	                                                                                                                                               
                  	</div>
                </div>
                 
             </div>
              </form>
</div>
<!--<script src="<?php //echo $this->basePath('/public/js/DatePicker/WdatePicker.js'); ?>"></script-->

<?php echo $this->partial('common/editor',array('edit_array'=>array('single_article_body'))); ?>
<script>
$(document).ready(function() {
	$("#cms_form").validate({
		rules: {
			single_article_title: {
				required: true,
				maxlength:60
			}
		},
		messages: {
			single_article_title: {
				required: "<?php echo $this->translate('请输入文章名称！'); ?>",
				maxlength:"<?php echo $this->translate('文章名称最长为60个汉字！'); ?>"
			}
		}
	});
});
//单页文章删除js
function single_article_del_js(single_article_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该单页文章吗？'); ?>')) {
	$.post("<?php echo $this->url('cms/default',array('action'=>'singleDel','controller'=>'cms')); ?>",{single_article_id:single_article_id},
	function(data){
		if(data != 'false') {
			window.location.href='<?php echo $this->url('cms/default',array('action'=>'singleArticle','controller'=>'cms')); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('单页文章删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>